﻿<%@ Page Language="C#" AutoEventWireup="true" masterpagefile="~/Admin/Main.master" title="文章列表" CodeFile="ArticleList.aspx.cs" Inherits="Admin_ArticleList" %>

<%@ Register TagPrefix="uc" TagName="ContentMenu" Src="~/Admin/ContentMenu.ascx"%>
<asp:Content ID="Content1" ContentPlaceHolderID="LeftMenu" Runat="Server">
    <uc:ContentMenu ID="ContentMenu" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MidContent" Runat="Server">
  <div id="mainMenu">
  	<ul>
		<li>
		    <asp:HyperLink ID="ArticleLink" runat="server">添加文章</asp:HyperLink>
		</li>
		<li><a href="ArticleList.aspx">文章列表</a></li><li><a href="ArticleEdit.aspx">编辑文章</a></li><li><a href="ArticleClass.aspx">分类管理</a></li></ul>
  </div>
   <div id="main">
   <asp:Label id="Msg" runat="server" Text="" CssClass="msg" Visible="False"></asp:Label>
    <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D7D7D7" id="mainTopTable">
      <tr>
        <td colspan="5" bgcolor="#FFFFFF" class="mainTitle">
            "<asp:Label ID="MenuName" runat="server" ForeColor="Black"></asp:Label>" 文章检索&nbsp;</td>
      </tr>
      <tr>
        <td align="right" bgcolor="#FFFFFF" >
            属于分类:</td>
          <td bgcolor="#ffffff">          
              <asp:DropDownList ID="ClassList" runat="server">
              </asp:DropDownList></td>
          <td bgcolor="#FFFFFF" align="right">
              文章标题/内容:</td>
          <td bgcolor="#FFFFFF">&nbsp;<asp:TextBox ID="ArticleTitle" runat="server" CssClass="inputText"></asp:TextBox>
              <asp:HiddenField ID="IsSearch" runat="server" Value="0" />
          </td>
          <td bgcolor="#ffffff">
              <asp:Button ID="Search" runat="server" CssClass="inputBt" Text="文章检索" OnClick="Search_Click" ValidationGroup="ArticleSearch" /></td>
      </tr>
    </table>
   <asp:GridView ID="ArticleList" runat="server" AllowPaging="True" AutoGenerateColumns="False" OnPageIndexChanging="ArticleList_PageIndexChanging" DataKeyNames="ArticleId,ArticleClassId" OnRowCancelingEdit="ArticleList_RowCancelingEdit" OnRowEditing="ArticleList_RowEditing" OnRowUpdating="ArticleList_RowUpdating" PageSize="11" OnRowDeleting="ArticleList_RowDeleting" CellPadding="0" CssClass="gv" Width="100%" EmptyDataText="暂无任何文章" OnRowDataBound="ArticleList_RowDataBound" >
        <Columns>
            <asp:BoundField DataField="ArticleId" HeaderText="ID" >
                <ControlStyle CssClass="gvOrderId" />
            </asp:BoundField>
            <asp:BoundField DataField="ClassName" HeaderText="所属分类" ReadOnly="True" SortExpression="ClassName" />
            <asp:BoundField DataField="Title" HeaderText="文章标题" ReadOnly="True" SortExpression="Title" />
            <asp:BoundField DataField="Author" HeaderText="文章作者" ReadOnly="True" SortExpression="Author" />
            <asp:BoundField DataField="AddTime" HeaderText="添加时间" ReadOnly="True" SortExpression="AddTime" />
            <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="80px" HeaderText="推荐">
                    <ItemTemplate>
                        <asp:CheckBox ID="ProductsLock" runat="server" AutoPostBack="True" Checked='<%# Eval("ArtTJ").ToString() == "True" ? true:false %>'
                            OnCheckedChanged="ProductsLock_CheckedChanged" />
                    </ItemTemplate>
                    <ItemStyle CssClass="gvBtAField" />
                </asp:TemplateField>
            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                <EditItemTemplate>
                    <asp:Button ID="UpdateBt" runat="server" CausesValidation="True" CommandName="Update"
                        Text="更新" />
                    <asp:Button ID="CancelBt" runat="server" CausesValidation="False" CommandName="Cancel"
                        Text="取消" />    
                </EditItemTemplate>
                <ItemStyle CssClass="gvCommandField" />
                <ItemTemplate>
                    &nbsp;<asp:Button ID="DelBt" runat="server" CausesValidation="False" CommandName="Delete" Text="删除" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="编辑文章">
                <ItemStyle CssClass="gvBtAField" />
                <ItemTemplate>
                    <asp:HyperLink ID="EditHyperLink" runat="server" NavigateUrl='<%# Eval("ArticleId", "ArticleEdit.aspx?ArticleId={0}") %>'
                        Text="编辑文章"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <RowStyle CssClass="gvRow" />
        <EditRowStyle CssClass="gvEditRow" />
        <PagerStyle CssClass="gvPage" />
        <HeaderStyle CssClass="gvHeader" />
        <AlternatingRowStyle CssClass="gvAlternatingRow" />
    </asp:GridView>

  </div>
  <script language="JavaScript" type="text/javascript" >
        topMenuThisPage(2);//当前位置顶部菜单标识
        contentSubMenuThisPage();//当前位置左侧菜单标识
        mainMenuThisPage(2);//当前选项卡标识
  </script>
</asp:Content>